package com.arpa.wms.cancel.delivery;

import com.arpa.ntocc.common.common.exception.ServiceException;
import com.arpa.wms.cancel.DeliveryCancelHandlerTypeConstants;
import com.arpa.wms.domain.entity.Delivery;
import com.arpa.wms.service.IDeliveryService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Component;

/**
 * 出库完成的订单取消处理
 *
 * @author leo
 */
@Log4j2(topic = "DELIVERIED")
@Component(DeliveryCancelHandlerTypeConstants.DELIVERIED)
public class DeliveriedCancelHandler extends AbstractDeliveryCancelHandler {

    @Override
    public boolean handle(IDeliveryService deliveryService, Delivery delivery) {
        throw new ServiceException("订单【"+delivery.getCode()+"】已出库，无法取消");
    }


}
